<html>
<head>
<style>
@page {
  size: 150px 160px;
  margin: 30px;
  -fs-max-overflow-pages: 10;
  -fs-overflow-pages-direction: ltr;
}
td, th {
  line-height: 20px;
  font-weight: normal;
}
thead th {
  color: red;
}
tfoot td {
  color: blue;
}

</style>
</head>
<body style="font-family: 'TestFont'; color: black; font-size: 12px;">
<table style="border-collapse: collapse; -fs-table-paginate: paginate;">
<caption>987654321</caption>
<thead>
  <tr><th style="">ABCDEF</th><th style="">GHIJKL</th></tr>
</thead>
<tbody>
  <tr><td style="">MNOPQR</td><td style="">STUVWXY</td></tr>
  <tr><td style="">Z12345</td><td style="">678901</td></tr>
  <tr><td style="">234567</td><td style="">890123</td></tr>
</tbody>
<tfoot>
  <tr><td>456789</td><td>012345</td></tr>
</tfoot>
</table>
</body>
</html>
